#include <iostream>
using namespace std;
class Date
{
    friend istream& operator>>(istream& in, Date& d);
public:
    Date(int year, int month, int day)
        :_year(year)
        ,_month(month)
        ,_day(day)
    {}

    void Print()
    {
        if ((_month < 10) && (_day < 10))
        {
            cout << _year << "-" << 0 << _month << "-" << 0 << _day << endl;
        }
        else if ((_month >= 10) && (_day < 10))
        {
            cout << _year << "-" << _month << "-" << 0 << _day << endl;

        }
        else if ((_month < 10) && (_day >= 10))
        {
            cout << _year << "-" << 0 << _month << "-" << _day << endl;
        }
        else
        {
            cout << _year << "-" << _month << "-" << _day << endl;
        }
    }

    static int GetMonthDay(int year, int month)
    {
        static int a[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
        if ((month == 2) && (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)))
        {
            return 29;
        }
        else
        {
            return a[month];
        }
    }

    bool operator<(const Date& x) const
    {
        if (_year < x._year)
        {
            return true;
        }
        else if (_year == x._year && _month < x._month)
        {
            return true;
        }
        else if (_year == x._year && _month == x._month && _day < x._day)
        {
            return true;
        }

        return false;
    }


    bool operator==(const Date& x) const
    {
        return _year == x._year
            && _month == x._month
            && _day == x._day;
    }

    bool operator!=(const Date& x) const
    {
        return !(*this == x);
    }

    Date operator++()
    {
        _day++;
        if (_day > GetMonthDay(_year, _month))
        {
            _day = 1;
            _month++;
            if (_month == 13)
            {
                _year++;
                _month = 1;
            }
        }
        return *this;
    }

    int operator-(const Date& d)
    {
        Date max = *this;
        Date min = d;
        int flag = 1;
        if (max < min)
        {
            max = d;
            min = *this;
            flag = -1;
        }
        int n = 0;
        while (max != min)
        {
            ++min;
            n++;
        }
        return n * flag;
    }

private:
    int _year;
    int _month;
    int _day;
};

istream& operator>>(istream& in, Date& d)
{
    int year, month, day;
    in >> year >> month >> day;
    d._year = year;
    d._month = month;
    d._day = day;
    return in;
}



//int main()
//{
//    int date1 = 0;
//    int date2 = 0;
//    cin >> date1 >> date2;
//    Date d1(date1 / 10000, (date1 % 10000) / 100, date1 % 100);
//    Date d2(date2 / 10000, (date2 % 10000) / 100, date2 % 100);
//    cout << (d1 - d2) << endl;
//    return 0;
//}




int main() 
{
    int a, b;
    while(cin >> a >> b)
    {
        Date d(a, 01, 00);
        while (b--)
        {
            ++d;
        }
        d.Print();
    }
    return 0;
}
